﻿using PropertyChanged;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VIA.SiMoJi.Domain
{
    [AddINotifyPropertyChangedInterface]
    public class FoxconnMESOption
    {
        public string IpAddress { get; set; } = "172.26.246.93";
        public string Uri { get; set; } = "http://172.26.246.93/fpca_automation/BussinessTransfer/mlbauto?";
        public string LQUri { get; set; } = "http://172.26.246.90/fpca_automation/BussinessTransfer/mlbauto?";
        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsUseMES { get; set; }
        /// <summary>
        /// 是否开启进站功能
        /// </summary>
        public bool IsUseStackIn { get; set; }
        /// <summary>
        /// 是否开启出站功能
        /// </summary>
        public bool IsUseStackOut { get; set; }
        /// <summary>
        /// 是否开启LQ功能
        /// </summary>
        public bool IsUseStackLQ { get; set; }
        /// <summary>
        /// 命令代码
        /// </summary>
        public MESItem C { get; set; } = new MESItem() { Key = "c", Value = "GENERIC_PASS_STATION_T" };
        /// <summary>
        /// 员工号
        /// </summary>
        public MESItem EMP { get; set; } = new MESItem() { Key = "EMP" };
        /// <summary>
        /// 线体
        /// </summary>
        public MESItem LINE { get; set; } = new MESItem() { Key = "LINE" };
        /// <summary>
        /// 机台号
        /// </summary>
        public MESItem MACHINE { get; set; } = new MESItem() { Key = "MACHINE" };
        /// <summary>
        /// 工位名称
        /// </summary>
        public MESItem STATION { get; set; } = new MESItem() { Key = "STATION" };
        /// <summary>
        /// 扫描了类型
        /// </summary>
        public MESItem SCANTYPE { get; set; } = new MESItem() { Key = "SCANTYPE", Value = "BC" };
        /// <summary>
        /// PANEL/BC/BC_LIST 产品条码
        /// </summary>
        public MESItem SN { get; set; } = new MESItem() { Key = "BC" };
        /// <summary>
        /// PANEL穴位號，整PANEL或者非PANEL時上傳N/A即可
        /// </summary>
        public MESItem PCBLIST { get; set; } = new MESItem() { Key = "PCBLIST", Value = "N/A" };
        /// <summary>
        /// 成品料號
        /// </summary>
        public MESItem MODELNAME { get; set; } = new MESItem() { Key = "MODELNAME", Value = "N/A" };
        /// <summary>
        /// 工單號
        /// </summary>
        public MESItem WO { get; set; } = new MESItem() { Key = "WO", Value = "N/A" };
        /// <summary>
        /// 載具
        /// </summary>
        public MESItem CARRIER { get; set; } = new MESItem() { Key = "CARRIER", Value = "N/A" };
        /// <summary>
        /// 模具
        /// </summary>
        public MESItem MOULD { get; set; } = new MESItem() { Key = "MOULD" };
        /// <summary>
        /// 蓋板
        /// </summary>
        public MESItem COVER { get; set; } = new MESItem() { Key = "COVER" };
        /// <summary>
        /// 不良位置 N/A
        /// </summary>
        public MESItem LOCATION { get; set; } = new MESItem() { Key = "LOCATION", Value = "N/A" };
        /// <summary>
        /// 不良現象，打不良則傳對應不良，不打不良則上傳N/A
        /// </summary>
        public MESItem SYMPTOM { get; set; } = new MESItem() { Key = "SYMPTOM", Value = "N/A" };
        /// <summary>
        /// 是否過站(0:僅做查詢是否可以過站。1:過站)
        /// </summary>
        public MESItem STATUS { get; set; } = new MESItem() { Key = "STATUS" };
        /// <summary>
        /// 備用欄位，不使用上傳N/A
        /// </summary>
        public MESItem PROP1 { get; set; } = new MESItem() { Key = "PROP1", Value = "N/A" };
        /// <summary>
        /// 備用欄位，不使用上傳N/A
        /// </summary>
        public MESItem PROP2 { get; set; } = new MESItem() { Key = "PROP2", Value = "N/A" };
        /// <summary>
        /// 備用欄位，不使用上傳N/A
        /// </summary>
        public MESItem PROP3 { get; set; } = new MESItem() { Key = "PROP3", Value = "N/A" };
        /// <summary>
        /// 備用欄位，不使用上傳N/A
        /// </summary>
        public MESItem PROP4 { get; set; } = new MESItem() { Key = "PROP4", Value = "N/A" };
        /// <summary>
        /// 備用欄位，不使用上傳N/A
        /// </summary>
        public MESItem PROP5 { get; set; } = new MESItem() { Key = "PROP5", Value = "N/A" };

        #region LQ接口
        public MESItem LQ_C { get; set; } = new MESItem() { Key = "C", Value = "" };
        /// <summary>
        /// 檢查線體名稱有效性
        /// </summary>
        public MESItem LQ_LINE { get; set; } = new MESItem() { Key = "LINE", Value = "" };
        /// <summary>
        /// 1.檢查工站有效性,是否存在於工站信息維護表中（ 测试工程/Apple工站維護）具體維護接口如下：测试工程/Apple工站維
        /// </summary>
        public MESItem LQ_STATION { get; set; } = new MESItem() { Key = "STATION", Value = "N/A" };
        /// <summary>
        /// 檢查機台號有效性
        /// </summary>
        public MESItem LQ_MACHINE_NAME { get; set; } = new MESItem() { Key = "MACHINE_NAME", Value = "N/A" };
        public MESItem LQ_ASSET_NAME { get; set; } = new MESItem() { Key = "ASSET_NAME", Value = "N/A" };
        public MESItem LQ_MAC_ID { get; set; } = new MESItem() { Key = "MAC_ID", Value = "N/A" };
        public MESItem LQ_UPLOAD_TYPE { get; set; } = new MESItem() { Key = "UPLOAD_TYPE", Value = "N/A" };
        public MESItem LQ_SN { get; set; } = new MESItem() { Key = "SN" };
        public MESItem LQ_LINE_PROPERTY { get; set; } = new MESItem() { Key = "LINE_PROPERTY", Value = "N/A" };
        public MESItem LQ_STATION_CHECK { get; set; } = new MESItem() { Key = "STATION_CHECK", Value = "N/A" };
        public MESItem LQ_CARRIER_SN { get; set; } = new MESItem() { Key = "CARRIER_SN", Value = "N/A" };
        public MESItem LQ_COVER_SN { get; set; } = new MESItem() { Key = "COVER_SN", Value = "N/A" };
        public MESItem LQ_VERSION { get; set; } = new MESItem() { Key = "VERSION", Value = "N/A" };
        #endregion
    }
    [AddINotifyPropertyChangedInterface]
    public class MESItem
    {
        public string Key { get; set; }
        public string Value { get; set; }
    }
}
